﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using ChatLib;

namespace Chat
{
    public partial class FormCreateTask : Form
    {
        private string contact;

        public FormCreateTask()
        {
            InitializeComponent();
        }

        public FormCreateTask(string con)
        {
            InitializeComponent();
            this.contact = con;
        }

        private void btnSendTask_Click(object sender, EventArgs e)
        {
            if (txtTask.Text != "" || txtTask.Text != null)
                SendTask(txtTask.Text);
        }

        void SendTask(string task)
        {
            Global.server.SendTask(Global.username, contact, task);
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
